<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<h:head>
    <title></title>
</h:head>
<h:body>

    <h:body>
        <h:form id="content">
            <p:dataTable id="dataTable" var="fitter" value="#{fitterTableBean.fitterList}" widgetVar="fitterTable"
                         emptyMessage="No fitters found with given criteria"
                         paginator="true" rows="5"
                         paginatorTemplate="{CurrentPageReport} {PageLinks} {RowsPerPageDropdown}"
                         paginatorPosition="bottom"
                         rowsPerPageTemplate="3,5,10,20">
                <f:facet name="header">
                </f:facet>

                <p:column id="productIDColumn" filterBy="#{fitter.fitterID}"
                          headerText="Product ID"  filterMatchMode="contains">
                    <h:outputText value="#{fitter.fitterID}" />
                </p:column>

                <p:column id="nameColumn" filterBy="#{fitter.name}"
                          headerText="Name" filterMatchMode="contains" >
                    <h:outputText value="#{fitter.name}" />
                </p:column>

                <p:column id="descriptionColumn" filterBy="#{fitter.information}"
                          headerText="Description"
                          filterMatchMode="contains">
                    <h:outputText value="#{fitter.information}" />
                </p:column>

                <p:column id="qualityRatingColumn" filterBy="#{fitter.qualityRating}"
                          headerText="Quality Rating" filterMatchMode="endsWith">
                    <h:outputText value="#{fitter.qualityRating}"/>
                </p:column>
            </p:dataTable>
            <p:commandButton onclick="add_dialog_form:add_dialog.show()" immediate="true" type="button" id="add_button" value="Add"/>
        </h:form>
        <ui:include src="add_fitter.xhtml"/>
    </h:body>
</h:body>
</html>
